﻿using System.Configuration;

namespace SaJiraSync.Config.Email
{
    public sealed class EmailSection : ConfigurationSection
    {
        [ConfigurationProperty("enabled", IsRequired = true)]
        public bool Enabled
        {
            get
            {
                return (bool)this["enabled"];
            }
        }

        [ConfigurationProperty("smtp", IsRequired = true)]
        public SmtpElement Smtp
        {
            get
            {
                return (SmtpElement)this["smtp"];
            }
        }

        [ConfigurationProperty("templates", IsRequired = false, IsDefaultCollection = true)]
        [ConfigurationCollection(typeof(TemplateElementCollection), AddItemName = "template")]
        public TemplateElementCollection Templates
        {
            get
            {
                return (TemplateElementCollection)this["templates"];
            }
        }
    }
}